package peer.p2pnet;

import java.net.InetAddress;

public class DBNodeIdent {
	public InetAddress ip;
	public int port;
	public DBNodeIdent(InetAddress ip,int DBServerPort){
		this.ip=ip;
		this.port=DBServerPort;
	}
	
	@Override
	public int hashCode(){
		return (ip.toString()+Integer.toString(port)).hashCode();
	}
	
	@Override
	public boolean equals(Object ob){
		DBNodeIdent ai=(DBNodeIdent)ob;
		if(ob==null){
			return false;
		}else{
			return ai.ip.equals(ip)&ai.port==port;
		}
	}
	
	public InetAddress getIp(){
		return ip;
	}
	public int getDBServerPort(){
		return port;
	}
}
